<?php /*a:1:{s:72:"E:\M_PROGECT\Test\API_dolphinphp\application\index\view\index\index.html";i:1586856106;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
</head>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
<!-- 引入组件库 -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>

<body>
<div id="container">
    <el-card class="box-card">
        <div slot="header" class="clearfix">
            <span>年份</span>
        </div>
        <div class="text item">
            <el-radio v-for="item in year" :key="item" v-model="select_year" :label="item" border size="medium" @change="getMonth">{{item}}</el-radio>
        </div>
    </el-card>
    <el-card class="box-card" style="margin-top: 20px" v-if="month.length>0">
        <div slot="header" class="clearfix">
            <span>月份</span>
        </div>
        <div class="text item">
            <el-radio v-for="item in month" :key="item" v-model="select_month" :label="item" border size="medium" @change="getDay">{{item}}</el-radio>
        </div>
    </el-card>
    <el-card class="box-card" style="margin-top: 20px" v-if="day.length>0">
        <div slot="header" class="clearfix">
            <span>日期</span>
        </div>
        <div class="text item">
            <a  v-for="(item,key) in day" :key="item.id" :href="'/index/index/setmap?id='+item.id">
                <el-button type="primary" size="medium">{{item.day}}</el-button>
            </a>
        </div>
    </el-card>
</div>



<script>
    var app = new Vue({
        el: '#container',
        data: {
            year:[],
            month:[],
            day:[],
            select_year:'',
            select_month:'',
            select_day:'',
        },
        methods: {
            getYear(){
                var _that = this
                axios.get('/api/fexcel/getYear')
                .then(function (response) {
                    _that.year = response.data.data
                })
                .catch(function (error) {
                    console.log(error);
                });
            },
            getMonth(val){
                var _that = this
                this.month = []
                this.day = []
                axios.get('/api/fexcel/getMonth?year='+val)
                    .then(function (response) {
                        _that.month = response.data.data
                    })
                    .catch(function (error) {
                        console.log(error);
                    });
            },
            getDay(val){
                var _that = this
                axios.get('/api/fexcel/getDay?year='+_that.select_year+'&month='+val)
                    .then(function (response) {
                        _that.day = response.data.data
                        console.log(_that.day)
                    })
                    .catch(function (error) {
                        console.log(error);
                    });
            },
        },
        mounted(){

        },
        created(){
            this.getYear()
        }
    })
</script>
</body>
</html>